<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateCouponBrandType extends Migrator
{
    public function up()
    {
        $sql = <<<SQL
CREATE TABLE `coupon_brand_type` (
  `id` int(11) UNSIGNED  NOT NULL  AUTO_INCREMENT,
  `name` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '品牌类型名称',
  `brand_id` int(11) NOT NULL  COMMENT '品牌id关联coupon_brand的id',
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(0未启用 1启用)',
  `sort` int(11) NOT NULL  DEFAULT '0' COMMENT '排序',
  `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
SQL;
        $this->execute($sql);
    }


    public function down()
    {
        $this->table('coupon_brand_type')->drop();
    }

}
